﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace QuanLyDiemSinhVien.Manager
{
    public class StudentInfo
    {
        private readonly int _studentId;
        private string _studentName;
        private int _classId;
        private int _examRoomId;
        private DateTime _createdDate;
        private DateTime _modifiedDate;
        private bool _status;

        public StudentInfo() { }

        public StudentInfo(DataTable dtb)
        {
            if (dtb != null && dtb.Rows.Count > 0)
            {
                _studentId = Convert.ToInt32(dtb.Rows[0][0].ToString());
                _studentName = dtb.Rows[0][1].ToString();
                _classId = Convert.ToInt32(dtb.Rows[0][2].ToString());
                _examRoomId = Convert.ToInt32(dtb.Rows[0][3].ToString());
                _status = Convert.ToBoolean(dtb.Rows[0][4].ToString());
            }
        }

        public int StudentId { get { return _studentId; } }

        public string StudentName
        {
            set { _studentName = value; }
            get { return _studentName; }
        }

        public int ClassId
        {
            set { _classId = value; }
            get { return _classId; }
        }

        public int ExamRoomId
        {
            set { _examRoomId = value; }
            get { return _examRoomId; }
        }

        public DateTime CreatedDate
        {
            set { _createdDate = value; }
            get { return _createdDate; }
        }

        public DateTime ModifiedDate
        {
            set { _modifiedDate = value; }
            get { return _modifiedDate; }
        }

        public bool Status
        {
            set { _status = value; }
            get { return _status; }
        }
    }
}
